<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<script type="text/javascript">
	function validation() {
		var frm = document.forms(0);
		if (frm.join_points.value == "" || frm.event_points.value == "" ) {
			alert("포인트를 입력해주세요. 포인트가 없을경우 0을 입력해주세요");
			return false;
		}else if( isNaN(frm.join_points.value) || isNaN(frm.event_points.value) ){
			alert("숫자만 입력해주세요");
			return false;
			
		}
		return true;
	}
</script>
<h2 class="page_title"><strong>포인트 현황</strong></h2>

<table class="table_view">
	<colgroup>
		<col width="300px"/>
		<col />
	</colgroup>
	<tr>
		<th>join_points_신규회원가입 포인트</th>
		<td><s:property value="ps_resultClass.join_points"/></td>
	</tr>
	<tr>
		<th>event_point_이벤트 포인트 </th>
		<td><s:property value="ps_resultClass.event_points"/></td>
	</tr>
	<tr>
		<th>total_points_총 판매 포인트</th>
		<td><s:property value="ps_resultClass.total_points"/></td>
	</tr>
	<tr>
		<th>total_price_총 판매 금액</th>
		<td><s:property value="ps_resultClass.total_price"/></td>
	</tr>
	<tr>
		<th>pay_way_보유 결제 방식</th>
		<td><s:property value="ps_resultClass.pay_way"/></td>
	</tr>
</table>

<form action="updatePointStatus.action" method="post" onsubmit="return validation();">
<fieldset>
<legend>포인트 변경</legend>
	<s:hidden name="no" value="%{ps_resultClass.no}" />
	<p class="mar_b_20">변경할 포인트를 작성해주세요. </p>
	<p><strong>JOIN POINT</strong> : <input type="text" maxlength="7" name="join_points" value="${ps_resultClass.join_points}" /></p>
	<p><strong>EVENT POINT</strong> : <input type="text" maxlength="7" name="event_points" value="${ps_resultClass.event_points}" /></p>
	<p class="mar_b_20">사용할 결제 방식을 선택해주세요. </p>
	<p>
		카드결제
		<input type="checkbox" name="pay_way" value="카드결제" checked="checked" />
		현금결제
		<input type="checkbox" name="pay_way" value="현금결제" checked="checked" />
	</p>
	<p class="align_r"><input type="submit" value="Register" /></p>
</fieldset>
</form>
<!-- 
create table pointstatus (
join_points number not null, 
event_points number default'0', 
total_points number default'0',
total_price number default'0',
pay_way varchar2(10) not null
);

create table buy_point (
no number not null,
id varchar2(20) not null primary key, 
buy_points number not null,
purchase_price number not null,
pay_way varchar2(10) not null, 
buy_date date 
);
create sequence buy_point_no_seq;
 -->
<s:if test="resultClass != null">
<h3 class="page_title"><strong>회원 정보</strong></h3>
<table class="table_view">
	<colgroup>
		<col width="200px"/>
		<col />
	</colgroup>
	<tr>
		<th>no</th>
		<td><s:property value="resultClass.no"/></td>
	</tr>
	 <tr>
	 	<th>phone</th>
	 	<td><s:property value="resultClass.phone1"/>-<s:property value="resultClass.phone2"/>-<s:property value="resultClass.phone3"/></td>
	 </tr>
</table>
<p class="align_r">
	<s:if test="resultClass.isadmin > 0"><font color="red"><strong>관리자 입니다.</strong></font></s:if>
	<s:else>
	<a href="javascript:registrationCheck('<s:property value="id"/>');"><font color="red"><strong>Administrator Registration [관리자 등록]</strong></font></a>
	</s:else>
</p>
</s:if>





